//
//  WKBaseTabBarController.m
//  fake_nuo_mi
//
//  Created by 王凯 on 16/6/29.
//  Copyright © 2016年 WK. All rights reserved.
//

#import "WKBaseTabBarController.h"

#import "WKHomeTableViewController.h"

#import "Public.h"

@interface WKBaseTabBarController ()

@end

@implementation WKBaseTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];

    // 添加tabBarItem
    [self addItem];
}


// 添加子控制器
- (void)addItem{
    
    UINavigationController *home = [self addChildControllerWithClass:[WKHomeTableViewController class] andItemName:@"主页" andItemImgaName:@"icon_tab_shouye"];
    
    self.viewControllers = @[home];
    
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : navigationBarColor} forState:UIControlStateSelected];
}

- (UINavigationController *)addChildControllerWithClass:(Class) className andItemName:(NSString *)name andItemImgaName:(NSString *)imageName{
    
    UIViewController *vc = [[className alloc]init];
    
    UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
    
    vc.title = name;
    
    
    
    return nav;
}

@end
